/**
 * Copyright &copy; 2017-2020 <a href="http://www.fosung.com/">FosungFrame</a> All rights reserved.
 */
package com.fosung.frame.modules.partycard.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.fosung.frame.common.utils.StringUtils;
import com.fosung.frame.common.web.BaseController;
import com.fosung.frame.modules.partycard.entity.Partycard;
import com.fosung.frame.modules.partycard.service.PartycardService;

/**
 * partyCardController
 * 
 * @author zhangfn
 * @version 2017-09-18
 */
@Controller
@RequestMapping(value = "${adminPath}/testcard/testcard")
public class TestcardController extends BaseController {

	@Autowired
	private PartycardService partycardService;

	@ModelAttribute
	public Partycard get(@RequestParam(required = false) String id) {
		Partycard entity = null;
		if (StringUtils.isNotBlank(id)) {
			entity = partycardService.get(id);
		}
		if (entity == null) {
			entity = new Partycard();
		}
		return entity;
	}

	@RequiresPermissions("partycard:partycard:view")
	@RequestMapping(value = { "list", "" })
	public String list(Partycard partycard, HttpServletRequest request, HttpServletResponse response, Model model) {
				return "modules/partycard/testcard";
	}

	@RequiresPermissions("partycard:partycard:view")
	@RequestMapping(value = "form")
	public String form(Partycard partycard, Model model) {

		return "modules/partycard/testcard";
	}


}